package com.hooper.iot.face.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @Author :     WANGCHENG
 * @Date :     2022/6/7 13:50
 * @Version:
 * @Description
 */
@Configuration
public class ExcutorPoolBean {
    @Bean(name= "poolExecutor")
    public ExecutorService executePool(){
        ExecutorService poolExecutor = new ThreadPoolExecutor(2, Integer.MAX_VALUE, 5L, TimeUnit.SECONDS, new ArrayBlockingQueue<>(1000));
        return poolExecutor;
    }
}
